<script setup lang="ts">
import { ref, reactive } from 'vue'
import SetupChild from './SetupChild.vue'
import SetupChild2 from './SetupChild2.vue'
import CompS from './comp/CompS.vue'

const count = ref(0)
const title = ref('这是title')
const titleObj = reactive({
    title: '这是obj'
})
function changeTitle(v: string) {
    title.value = v;
}
</script>
<template>
  <div>
    <comp-s></comp-s>

    <hr>
    count: {{ count }}
    <SetupChild @change-title='changeTitle' :title='title'></SetupChild>
    <SetupChild2 @change-title="(v)=>title=v" :title='title'></SetupChild2>
    <SetupChild2 @change-title="(v)=>title=v" v-bind='titleObj'></SetupChild2>
  </div>
</template>
